import socket

r = socket.socket()
adress = ("127.0.0.1",7000)
r.bind(adress)
r.listen(3)

while True:
    c,adr = r.accept()
    while True:
        try:
            data = c.recv(1024)
        except Exception:
            break
        print(str(data,"utf8"))
        if not data:
            break
        i = input("输入：")
        c.send(bytes(i,"utf8")) #传输要用二进制

r.close()

